//
//  ModelDetailCtrl.m
//  Traveling
//
//  Created by Northwan on 15/6/10.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "ModelDetailCtrl.h"
#import "ModelHeaderView.h"
#import "HeaderWebView.h"
@interface ModelDetailCtrl ()
@property(nonatomic,strong)HomeItemDetailHeaderModel *result;
@property(nonatomic,copy)NSString *titleText;
@property(nonatomic,strong)ModelHeaderView *headerView;
@end

@implementation ModelDetailCtrl
-(instancetype)initWithData:(HomeItemDetailHeaderModel *)result title:(NSString *)title{
    self = [super init];
    if(self){
        self =  [[ModelDetailCtrl alloc]init];
        self.result = result;
        self.titleText = title;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:self.titleText];
    
    self.headerView = [ModelHeaderView initHeaderView];
    [self.headerView initData:self.result];
    self.headerView.x = 0;
    self.headerView.y = 0;
    HeaderWebView *webView = [[HeaderWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height-64)];
    [webView setHeaderView:self.headerView];
    webView.url = self.result.contentUrl;
    [self.view addSubview:webView];
}

@end
